﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using Nancy;

namespace NancyAngularJSDemo
{
    public class HomeModule:NancyModule
    {
        public HomeModule()
        {
            this.Get["/"] = x =>
            {
                return this.View["home"];
            };

            this.Get["/server_processing"] = x =>
            {
                var json = System.IO.File.ReadAllText(@"E:\ecobp\WMS-Modular\trunk\WebModular.AdminApp\data\server_processing.txt");

                var draw = this.Request.Query.draw;
                json = json.Replace("\"draw\": 1,", "\"draw\": " + draw + ",");

                return this.Response.AsText(json, "application/json");
            };
        }
    }
}